home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Sample Code / AOCE Sample Code / PowerTalk Access Modules / Sample CSAM / Sources / SKEL•CSAM_SetUp.R < prev    next >
Encoding:
Text File  |  1995-07-28  |  8.0 KB  |  247 lines  |  [TEXT/MPS ]

  1. //    --------------------------------------------------------------------------
  2. //    LDAP Directory Record • Aspect Template
  3.  
  4. #define kCatalogAspectName "SKEL•SetUp Aspect"
  5. #define kCatalogInfoPageName "SKEL•SetUp InfoPage"
  6.  
  7. #define kCatalogRecordType kDirectoryRecTypeBody "ldaP"
  8. #define kSignature    'ldaP'
  9.  
  10. #define kPr_ldapServerName (kSAMFirstDevProperty + 0)
  11. #define kPr_ldapServerNameIndex (kSAMFirstDevProperty + 1)
  12. #define kPr_ldapSearchBase (kSAMFirstDevProperty + 2)
  13. #define kPr_ldapSearchBaseIndex (kSAMFirstDevProperty + 3)
  14.  
  15.  
  16. resource 'deta' (ldapSetupAspectID, kCatalogAspectName, purgeable) { 
  17.     0, dropCheckConflicts, isMainAspect 
  18. };
  19.  
  20. resource 'rstr' (ldapSetupAspectID + kDETTemplateName, "SKEL•SetUp Aspect Name", purgeable) {
  21.     kCatalogAspectName
  22. };
  23.  
  24. resource 'rstr' (ldapSetupAspectID + kDETRecordType, "SKEL•SetUp Aspect Record Type", purgeable) {
  25.     kCatalogRecordType                    // "aoce Directory"…"ldaP"
  26. };
  27.  
  28. resource 'rstr' (ldapSetupAspectID + kDETAspectKind, "SKEL•SetUp Aspect Kind", purgeable) {
  29.     "X.500 Catalog"                        // used for "Get Info..."
  30. };
  31.  
  32. resource 'rstr' (ldapSetupAspectID + kDETAspectName, "SKEL•SetUp Aspect Name", purgeable) {
  33.     "« Aspect-Name »"                        //    ... Key Chain 'system' field
  34. };
  35.  
  36. resource 'rstr' (ldapSetupAspectID + kDETAspectWhatIs, "SKEL•SetUp Aspect WhatIs", purgeable) {
  37.     "Contains information about this key, which represents an X.500 catalog "
  38.     "connected to by the TCP/IP Lightweight Directory Access Protocol (LDAP)."
  39. };
  40.  
  41. resource 'rst#' (ldapSetupAspectID + kDETAspectBalloons, "SKEL•SetUp Aspect Balloons", purgeable) {
  42.     {
  43.         "Click this to set something.",                            "ERROR",
  44.         "Press this button to bind to an LDAP server.",        "ERROR"
  45.     }
  46. };
  47.  
  48. resource 'dett' (ldapSetupAspectID + kDETAspectLookup, "SKEL•SetUp Aspect Lookup", purgeable) {
  49.     {
  50.         { "ldapServerName" }, typeBinary,
  51.             useForInput, useForOutput, notInSublist, isNotAlias, isNotRecordRef,
  52.                 {
  53.                     'rstr', kPr_ldapServerName, 0;
  54.                     'long', kPr_ldapServerNameIndex, 0;
  55.                 },
  56.  
  57.         { "ldapSearchBase" }, typeBinary,
  58.             useForInput, useForOutput, notInSublist, isNotAlias, isNotRecordRef,
  59.                 {
  60.                     'rstr', kPr_ldapSearchBase, 0;
  61.                     'long', kPr_ldapSearchBaseIndex, 0;
  62.                 }
  63.     }
  64. };
  65.  
  66. resource 'rstr' (ldapSetupAspectID + kSAMAspectUserName, purgeable)    {
  67.     "« User-Name »"                        //    ... Key Chain 'name' field
  68. };
  69.  
  70. resource 'rstr' (ldapSetupAspectID + kSAMAspectKind, purgeable)    {
  71.     "X.500 Catalog"                        //    ... Key Chain 'kind' field
  72. };
  73.  
  74. resource 'detn' (ldapSetupAspectID + kSAMAspectCannotDelete, purgeable)    {
  75.     0;
  76. };
  77.  
  78. resource 'sami' (ldapSetupAspectID + kSAMAspectSlotCreationInfo, purgeable) {
  79.     1, kSignature, notMSAM, servesDSAM,
  80.     "X.500 Catalog", "Unbound X.500 Catalog"
  81. };
  82.  
  83. include "SKEL•CSAM.DETC" 'detc'(0) as 'detc'(ldapSetupAspectID + kDETAspectCode,  purgeable);
  84.  
  85. include "SKEL•CSAM.ICON" 'ICN#' (129) as 'ICN#' (ldapSetupAspectID + kDETAspectMainBitmap, "SKEL•SetUp InfoPage", purgeable);
  86. include "SKEL•CSAM.ICON" 'ics#' (129) as 'ics#' (ldapSetupAspectID + kDETAspectMainBitmap, "SKEL•SetUp InfoPage", purgeable);
  87. include "SKEL•CSAM.ICON" 'icl8' (129) as 'icl8' (ldapSetupAspectID + kDETAspectMainBitmap, "SKEL•SetUp InfoPage", purgeable);
  88. include "SKEL•CSAM.ICON" 'ics8' (129) as 'ics8' (ldapSetupAspectID + kDETAspectMainBitmap, "SKEL•SetUp InfoPage", purgeable);
  89. include "SKEL•CSAM.ICON" 'icl4' (129) as 'icl4' (ldapSetupAspectID + kDETAspectMainBitmap, "SKEL•SetUp InfoPage", purgeable);
  90. include "SKEL•CSAM.ICON" 'ics4' (129) as 'ics4' (ldapSetupAspectID + kDETAspectMainBitmap, "SKEL•SetUp InfoPage", purgeable);
  91.  
  92. include "SKEL•CSAM.ICON" 'SICN' (129) as 'SICN' (ldapSetupAspectID + kDETAspectMainBitmap, "SKEL•SetUp InfoPage", purgeable);
  93.  
  94. #define serverNameMenuID 1000
  95. #define searchBaseMenuID 1001
  96.  
  97. resource 'fmnu' (serverNameMenuID) {
  98.     kPr_ldapServerNameIndex,
  99.     {
  100.         1, "« you must choose a server name »";
  101.         2, "ldap.itd.umich.edu";
  102.         3, "x500.gsfc.nasa.gov";
  103. #ifdef EXTRAHOSTS
  104.         4, "rearwindow.rs.itd.umich.edu";
  105.         5, "letham.uis.itd.umich.edu";
  106.         6, "wp.trw.com";
  107.         7, "ldap.LBL.Gov";
  108.         8, "ldap2.LBL.Gov";
  109. #endif
  110.     }
  111. };
  112.  
  113. resource 'fmnu' (searchBaseMenuID) {
  114.     kPr_ldapSearchBaseIndex,
  115.     {
  116.         1, "« you must choose a search base »";
  117.         2, "o=university of michigan, c=us";
  118.         3, "o=national aeronautics and space administration, c=us";
  119. #ifdef EXTRAHOSTS
  120.         4, "o=\"apple computer, inc.\", c=us";
  121.         5, "o=\"trw inc.\", c=us";
  122.         6, "o=lawrence berkeley laboratory, c=us"
  123. #endif
  124.     }
  125. };
  126. //eject
  127. //    --------------------------------------------------------------------------
  128. //    LDAP Directory Record • InfoPage Template
  129.  
  130. //                        +---------x---------x---------x---------+
  131. //                        | +---+                                 |
  132. //                        | |   |                                 |
  133. //                        | +---+                                 |
  134. //    serverName: ->    |    [_________] [__________________]   |
  135. //    searchBase: ->    |    [___110___] [_______207________]   |
  136. //                        |                                       |
  137. //                        |                                       |
  138. //                        |                                       |
  139. //                        |                                       |
  140. //                        |                                       |
  141. //                        |                                       |
  142. //                        |                                       |
  143. //                        +---------x---------x---------x---------+
  144.  
  145. #define GapW 2
  146. #define c1W 110
  147. #define c2W 207
  148.  
  149. #define GapH 22
  150. #define statH 18
  151. #define editH 17
  152.  
  153. #define c1L 42
  154. #define c1R c1L+c1W
  155. #define c2L c1R+GapW
  156. #define c2R c2L+c2W
  157.  
  158. #define snT 58
  159.  
  160. #define cnLabelRect {snT, c1L, snT+statH, c1L+c1W}
  161. #define cnPopupRect {snT-2, c2L, snT-2+editH, c2R}
  162. #define cnFieldRect {snT-2+64, c2L, snT-2+editH+64, c2R}
  163.  
  164. #define sbT snT+GapH
  165.  
  166. #define onLabelRect {sbT, c1L, sbT+statH, c1R}
  167. #define onPopupRect {sbT-2, c2L, sbT-2+editH, c2R}
  168. #define onFieldRect {sbT-2+64, c2L, sbT-2+editH+64, c2R}
  169.  
  170.  
  171. resource 'deti' (ldapSetupInfoPageID, kCatalogInfoPageName, purgeable) {
  172.     1000,                                                                // sort order
  173.     kDETNoSublistRect,                                            // sublist rectangle
  174.         noSelectFirstText,
  175.         {                                                                //    header view lists
  176.             kDETNoProperty, kDETNoProperty,
  177.                 ldapSetupInfoPageID
  178.         },
  179.         { }                                                            //    subview view lists
  180. };
  181.  
  182. resource 'detv' (ldapSetupInfoPageID, kCatalogInfoPageName, purgeable) {
  183.     {
  184.         kDETSubpageIconRect, kDETNoFlags, kDETAspectMainBitmap,
  185.             Bitmap
  186.                 { kDETLargeIcon },
  187.  
  188.         {45, 0, 46, kDETRecordInfoWindWidth}, kDETNoFlags, kDETNoProperty,
  189.             Box
  190.                 { kDETBoxIsGrayed },
  191.  
  192. //    --    serverName popup menu
  193.  
  194.         cnLabelRect, kDETNoFlags, kDETNoProperty,
  195.             StaticTextFromView
  196.                 { kDETApplicationFont, 10, kDETRight, kDETBold, "ldapServerName:" },
  197.  
  198.         cnPopupRect, kDETEnabled, kPr_ldapServerNameIndex,
  199.             Menu
  200.                 { kDETApplicationFont, 10, kDETLeft, kDETNormal,
  201.                   "", kPr_ldapServerNameIndex, serverNameMenuID },
  202.  
  203. //    --    searchBase popup menu
  204.  
  205.         onLabelRect, kDETNoFlags, kDETNoProperty,
  206.             StaticTextFromView
  207.                 { kDETApplicationFont, 10, kDETRight, kDETBold, "ldapSearchBase:" },
  208.  
  209.         onPopupRect, kDETEnabled, kPr_ldapSearchBaseIndex,
  210.             Menu
  211.                 { kDETApplicationFont, 10, kDETLeft, kDETNormal,
  212.                   "", kPr_ldapSearchBaseIndex, searchBaseMenuID },
  213.  
  214. #define kfT 200
  215.         {kfT, 8, kfT+12, kDETRecordInfoWindWidth-8}, kDETNoFlags, kDETNoProperty,
  216.             StaticTextFromView
  217.                 { kDETApplicationFont, 9, kDETCenter, kDETNormal,
  218.                     "Copyright © 1993 "
  219.                     "The Regents of the University of Michigan. "
  220.                     "All Rights Reserved." },
  221.  
  222.         {kfT+13, 8, kfT+25, kDETRecordInfoWindWidth-8}, kDETNoFlags, kDETNoProperty,
  223.             StaticTextFromView
  224.                 { kDETApplicationFont, 9, kDETCenter, kDETNormal,
  225.                     "Version " VERSION " | Gavin Eadie (Internet: Gavin@UMich.EDU | AppleLink: A67)" }
  226.     }
  227. };
  228.  
  229. resource 'rstr' (ldapSetupInfoPageID + kDETTemplateName, "SKEL•SetUp InfoPage Name", purgeable) {
  230.     kCatalogInfoPageName
  231. };
  232.  
  233. resource 'rstr' (ldapSetupInfoPageID + kDETRecordType, "SKEL•SetUp InfoPage Record Type", purgeable) {
  234.     kCatalogRecordType
  235. };
  236.  
  237. resource 'rstr' (ldapSetupInfoPageID + kDETInfoPageName, "SKEL•SetUp InfoPage Name", purgeable) {
  238.     "X.500 Catalog"
  239. };
  240.  
  241. resource 'rstr' (ldapSetupInfoPageID + kDETInfoPageMainViewAspect, "SKEL•SetUp InfoPage Main View", purgeable) {
  242.     kCatalogAspectName
  243. };
  244.  
  245. #undef ldapSetupAspectID
  246. #undef ldapSetupInfoPageID
  247.